import { createApp } from "vue";
import ElementPlus, { ElLoading, ElMessage, ElMessageBox } from "element-plus";
import "element-plus/dist/index.css";
import zhCn from "element-plus/es/locale/lang/zh-cn";
import App from "./App.vue";

import utils from "@/utils"; //公共方法
import GlobalComponent from '@/components/index' //过滤器

const app = createApp(App);
// 注册全局组件
GlobalComponent.install(app);

// 注册全局公共方法
// app.config.globalProperties.$filters = filters
app.config.globalProperties.$utils = utils;
app.config.globalProperties.$loading = ElLoading.service;
app.config.globalProperties.$msgBox = ElMessageBox;
app.config.globalProperties.$alert = ElMessageBox.alert;
app.config.globalProperties.$confirm = ElMessageBox.confirm;
app.config.globalProperties.$message = ElMessage;
app.use(ElementPlus, {
  locale: zhCn,
});

app.mount('#app')
